/* 
 * File:   Triangle.h
 * Author: brady
 *
 * Created on February 4, 2011, 11:15 PM
 */


#ifndef TRIANGLE_H
#define	TRIANGLE_H

#include "Shape.h"
#include "LambertianShader.h"

class Triangle : public Shape{
public:
    Triangle();
    Triangle(Vector3D p1, Vector3D p2, Vector3D p3);
    virtual ~Triangle();
    bool TestIntersect(Ray &ray, double tmin, double tmax, HitStruct& hitStruct /* = 0 */);
//    const Vector3D SurfaceNormal(Ray &ray);
    void SetShader(Shader* shader){this->shader = shader;}
    Shader* GetShader(){return this->shader;}
    double GetSortValue(int sortBy);
private:
    Vector3D P1;
    Vector3D P2;
    Vector3D P3;
    Vector3D normal;
};

#endif	/* TRIANGLE_H */

